package com.xqboss.apps.service.order.status;

import com.xqboss.apps.domain.order.OrderMain;
import com.xqboss.apps.enums.order.OrderStatusEnum;
import com.xqboss.apps.mapper.order.OrderMainMapper;
import com.xqboss.apps.service.order.OrderService;

/**
 * <p>
 *     订单状态执行器
 * </p>
 * @author Trent
 * @date 2023/8/21
 */
public abstract class OrderStatusExecutor {

    /**
     * 前置执行校验
     */
    protected abstract void preValidate(OrderMain order);

    /**
     * 执行更新
     */
    protected abstract void execUpdate(OrderMain order);

    /**
     * 后置执行任务
     */
    protected abstract void postExec(OrderMain order);


    public void exec(OrderMain order){
        preValidate(order);
        execUpdate(order);
        //TODO yutong 后期加队列
        postExec(order);
    }
}
